package com.woniu.inlet.web.command;

import com.woniu.inlet.web.fo.UserFo;
import com.woniu.service.domain.UserDo;
import com.woniu.utils.ApplicationContextHolder;
import lombok.Data;

@Data
public class LoginCommand {
    private UserFo userFo;
    private LoginCommandHandler handler;

    public LoginCommand() {
        this.handler = ApplicationContextHolder.getApplicationContext().getBean(LoginCommandHandler.class);
    }

    public LoginCommand(UserFo userFo) {
        this();
        this.userFo = userFo;
    }

    public UserDo execute() {
        return handler.action(this);
    }
}
